<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>物料信息</title>
		<link rel="stylesheet" type="text/css" href="../css/supplyProceOrserStyle.css" />
		<script type="text/javascript" src="../js/jquery.min.js" charset="utf-8"></script>
		<script src="../js/deom.js" type="text/javascript" charset="utf-8"></script>
		<meta name="viewport" content=" height=device-height,
			          width=device-width,
			          initial-scale=1.0,
			          minimum-scale=1.0,
			          maximum-scale=1.0,
			          user-scalable=no" />
		<script type="text/javascript">
			$(function() {
				var bomId = localStorage.getItem("bomId");
				var token = localStorage.getItem("token");
				var ip = localStorage.getItem("ip");
				var imagePath=[];
				$.ajax({
					type: 'post', //类型
					url: ip + 'bom/details', //请求路径
					contentType: 'application/x-www-form-urlencoded', //默认
					dataType: 'json', //返回数据类型  可以是text：字符串  可以是json：json对象
					data: {
						'bomId': bomId,
						'token': token,
					}, //数据
					success: function(result) {
						if(result.code == 200) {
							var txts = '';
							for(var Key in result.data.wxBomPicture) {
								var imagePath =result.data.wxBomPicture[Key].imagePath;
								if(imagePath == null){
									imagePath ='http://39.108.187.126:8080/nop.png';
								}
								txts = txts + '<a class="ig" onclick=' + 'getimgs('+'"'+imagePath+'"'+');>';
								txts = txts + '<img class="imgs" src="' + imagePath + '"/></a>';
							}
							$(".igclass").append(txts);
							var protit = result.data.partsName + result.data.bomCategory;
							document.getElementById('title').value = protit;
							var unitPrice = result.data.price;
							document.getElementById('unitPrice').innerText = unitPrice;
							var taxPrice = result.data.priceTax;
							document.getElementById('taxPrice').innerText = taxPrice;
							var proSellerNum = result.data.bomNum;
							document.getElementById('proSellerNum').innerText = proSellerNum;
						} else {
							alert('获取数据异常,请重新登录');
							//window.location.href = 'Login.html';
						}
					},
					error: function(data) { //若果传过来的数据为空
					}
				});
			});
			function getimgs(imagePath) {
				window.open(imagePath);
			}
			function getMaterielInfoModify(){
				window.location.href = 'materielInfoModify.html';
			}
		</script>
	</head>

	<body>
		<div id="igs" class="igclass">
		</div>
		<div class="btn btn1">
			<</div>
				<div class="btn btn2">></div>
				<textarea id="title" class="pro_tit">物料名称+物料类别</textarea>
				<div class="pro_much">
					<label>价&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;格:</label>
					<font id="unitPrice">价格</font><br /><br />
					<label>含&nbsp;税&nbsp;价:</label>
					<font id="taxPrice">含税价</font>
				</div>
				<div class="pro_info">
					<label>物料编码:</label>
					<font id="proSellerNum">物料编码</font>
				</div>
				<input class="div-but-submit" type="text" value="修改信息" onclick="getMaterielInfoModify()" />
	</body>

</html>
